package com.alks.yn_zs.controller;

import com.alks.common.aop.ApiRestController;
import com.alks.common.aop.WebLogger;

import com.alks.entity.data.response.ResponseInfo;

import com.alks.yn_zs.data.request.StatsRequest;
import com.alks.yn_zs.service.StitchShowService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @description: 针车看板
 */
@Slf4j
@RestController
@ApiRestController("/show/finishStore")
@Api(value = "生产", tags = "针车一课目视管理看板")
public class StitchShowController {

    @Resource
    private StitchShowService stitchShowService;

    //1.月生产状况  目标产量，实际产量
    //2.月生产达成率
    //3.日生产状况
    //4.（？）组人均产能
    @WebLogger
    @PostMapping("/getMonthProduction")
    @ApiOperation(value = "查询月生产状况", tags = "针车一课目视管理看板")
    public ResponseInfo getMonthProduction(@RequestBody StatsRequest request, @RequestParam int deptId) {
        return stitchShowService.getMonthProduction(deptId,request);
    }

    @WebLogger
    @PostMapping("/getDailyProduction")
    @ApiOperation(value = "查询日生产状况", tags = "针车一课目视管理看板")
    public ResponseInfo getDailyProduction(@RequestBody StatsRequest request,@RequestParam int deptId) {
        return stitchShowService.getDailyProduction( deptId,request);
    }

    @WebLogger
    @PostMapping("/getPersonProduction")
    @ApiOperation(value = "查询每组的人均产能", tags = "针车一课目视管理看板")
    public ResponseInfo getPersonProduction(@RequestBody StatsRequest request,@RequestParam int deptId ,@RequestParam String deptNo) {
        return stitchShowService.getPersonProduction(deptNo, deptId,request);
    }

    @WebLogger
    @GetMapping("/getdeptList")
    @ApiOperation(value = "查询所有组别", tags = "针车一课目视管理看板")
    public ResponseInfo getdeptList(@RequestParam int deptId) {
        return stitchShowService.getdeptList( deptId);
    }


}
